﻿Imports System
Imports System.Drawing

Namespace System.Workflow.ComponentModel.Design
    Public MustInherit Class DesignerGlyph
        ' Methods
        Protected Sub New()
        End Sub

        Friend Sub Activate(ByVal designer As ActivityDesigner)
            Me.OnActivate(designer)
        End Sub

        Friend Sub Draw(ByVal graphics As Graphics, ByVal designer As ActivityDesigner)
            Me.OnPaint(graphics, False, WorkflowTheme.CurrentTheme.AmbientTheme, designer)
        End Sub

        Friend Sub DrawActivated(ByVal graphics As Graphics, ByVal designer As ActivityDesigner)
            Me.OnPaint(graphics, True, WorkflowTheme.CurrentTheme.AmbientTheme, designer)
        End Sub

        Public Overridable Function GetBounds(ByVal designer As ActivityDesigner, ByVal activated As Boolean) As Rectangle
            If (designer Is Nothing) Then
                Throw New ArgumentNullException("designer")
            End If
            Return designer.Bounds
        End Function

        Protected Overridable Sub OnActivate(ByVal designer As ActivityDesigner)
        End Sub

        Friend Shared Function OnComparePriority(ByVal x As DesignerGlyph, ByVal y As DesignerGlyph) As Integer
            Return (y.Priority - x.Priority)
        End Function

        Protected MustOverride Sub OnPaint(ByVal graphics As Graphics, ByVal activated As Boolean, ByVal ambientTheme As AmbientTheme, ByVal designer As ActivityDesigner)


        ' Properties
        Public Overridable ReadOnly Property CanBeActivated As Boolean
            Get
                Return False
            End Get
        End Property

        Public Overridable ReadOnly Property Priority As Integer
            Get
                Return &H2710
            End Get
        End Property


        ' Fields
        Friend Const CommentPriority As Integer = 3
        Friend Const ConfigErrorPriority As Integer = 2
        Friend Const ConnectionPointPriority As Integer = 1
        Friend Const ConnectorDragDropPriority As Integer = 2
        Friend Const FadeGlyphPriority As Integer = 3
        Public Const HighestPriority As Integer = 0
        Friend Const LockedGlyphPriority As Integer = 3
        Public Const LowestPriority As Integer = &HF4240
        Friend Const MoveAnchorPriority As Integer = 1
        Friend Const NonExecutionStatePriority As Integer = 5
        Public Const NormalPriority As Integer = &H2710
        Friend Const ReadOnlyGlyphPriority As Integer = 3
        Friend Const SelectionPriority As Integer = 4
    End Class
End Namespace

